//
//  UILabel+Extension.swift
//  Weibo
//
//  Created by mac on 16/1/15.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

extension UILabel {

    convenience init(title:String, color: UIColor, fontSize: CGFloat,marginSize: CGFloat = 0){
        self.init()
        self.text = title
        self.textColor = color
        self.textAlignment = .Center
        self.font = UIFont.systemFontOfSize(fontSize)
        self.numberOfLines = 0
        if marginSize > 0 {
            self.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.size.width - 2 * marginSize
            self.textAlignment = .Left
        }
        self.sizeToFit()
    }
    
}
